#ifndef _SVPWM_H
#define _SVPWM_H
#include "main.h"
#include "vf_activate.h"
#define REGISTER 0.005F
typedef struct 
{
    float TEMP1_p;
    float TEMP2_P;
    float TEMP3_P;
  //  uint16_t sector_P;  
}svpwm_t;

typedef struct 
{
    float iabc_finnal[3];
    float uabc_finnal[3];
}cur_voltage_data;

typedef struct{
    float now_speed;
    float now_theta;
    float ialpha;
    float ibeta;
    float id;
    float iq;
    float ttf_speed_ref;
}motor_infor_t;

typedef struct {
    float duty_show[3];
		float uabc[3];
		float ibac[3];
    uint8_t tail_data[4];
}VOFA_SHOW_DATA_T;
extern svpwm_t svpwm;
extern cur_voltage_data cur_voltage_f;
void svpwm_func(float ud ,float uq ,float theta,float Udc,float Tpwm,svpwm_t* sv);
void FOC_INIT(TIM_HandleTypeDef* adc_tim,ADC_HandleTypeDef* hadc1);
void FOC_GO_currunt_voltage(cur_voltage_data* cur_voltage);

void set_pwm_tim_value(TIM_HandleTypeDef *TIMx, uint32_t CompareValue_0,
                                                uint32_t CompareValue_1,
                                                uint32_t CompareValue_2);
#endif
